home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / ieee_real.z / ieee_real
Encoding:
Text File  |  2002-10-03  |  3.8 KB  |  84 lines

  1. IEEE_REAL(3I)                                         Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      IIEEEEEE__RREEAALL - Converts _x to a real value
  6.  
  7. SSYYNNOOPPSSIISS
  8.      IIEEEEEE__RREEAALL (([XX==]_x [,, [YY==]_y]))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS/mk, IRIX systems, CRAY T90 systems that support IEEE
  12.      floating-point arithmetic
  13.  
  14.      CF90, MIPSpro 7 Fortran 90
  15.  
  16. SSTTAANNDDAARRDDSS
  17.      Fortran extension
  18.  
  19.      IEEE Standard for Binary Floating-point Arithmetic
  20.  
  21. DDEESSCCRRIIPPTTIIOONN
  22.      The IIEEEEEE__RREEAALL intrinsic function converts _x to a real value according
  23.      to the rounding mode currently in effect.  It accepts the following
  24.      arguments:
  25.  
  26.      _x         Can be of type real or integer.  It can be scalar or an
  27.                array.
  28.  
  29.      _y         If specified, must be scalar and of type real.
  30.  
  31.      IIEEEEEE__RREEAALL is an elemental function.  The name of this intrinsic cannot
  32.      be passed as an argument.
  33.  
  34. RREETTUURRNN VVAALLUUEESS
  35.      The result type and type parameters are as follows.  If _y is absent,
  36.      the result type and type parameter are default real.  If _y is present,
  37.      the result type and type parameter are the same type and type
  38.      parameter as _y.  If _x is an array, the result is an array of the same
  39.      shape as _x.
  40.  
  41.      If _y is absent, the result is a default real rounded from _x according
  42.      to the rounding mode currently in effect.  When _x is of type integer,
  43.      this form of IIEEEEEE__RREEAALL is useful for converting an integer value that
  44.      has more significant bits than the number of bits in the mantissa of
  45.      the default real format or the format of _y.  IIEEEEEE__RREEAALL, in this case,
  46.      rounds the integer according to the number of bits in the mantissa.
  47.      For example, suppose that on some machine an integer can hold 5
  48.      decimal digits, but the floating-point format of the same size can
  49.      only hold 4.  The result of IIEEEEEE__RREEAALL((1100112266)) on this machine would be
  50.      1.013E+3 if the current rounding mode is round-to-nearest.  This form
  51.      of IIEEEEEE__RREEAALL is also useful when converting a double precision _y to
  52.      (default) single precision and, in the process, rounding the
  53.      fractional value in the mantissa according to the rounding mode
  54.      currently in effect.
  55.  
  56.      If _y is present, the result is of type real with the same kind type
  57.      parameter value as _y and whose value is rounded from _x according to
  58.      the rounding mode currently in effect.  This form of IIEEEEEE__RREEAALL has
  59.      essentially the same uses as those described in the previous
  60.      paragraph, but it allows you to specify a result type of something
  61.      other than default real.  For example, this form would be useful to
  62.      convert quad precision real to double precision (and rounding in the
  63.      process) on IRIX systems.
  64.  
  65.      If _x is scalar, the result is scalar.
  66.  
  67.      If _x is an array, the result is an array in which each element is the
  68.      value of _x  rounded to the type and type parameter of _y.
  69.                _i
  70. EEXXAAMMPPLLEESS
  71.           ! Assume that the following program is compiled and executed on
  72.           ! a 32-bit machine.
  73.           INTEGER k
  74.           ...                     ! X is filled with a value that
  75.           ...                     ! has more than 23 significant bits.
  76.           PRINT *, IEEE_REAL(k)
  77.  
  78.      Variable kk is converted to type default real and rounded to fit into
  79.      23 bits according to the rounding mode currently in effect.
  80.  
  81. SSEEEE AALLSSOO
  82.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  83.      man page.
  84.